package org.opens.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * @Date 2021/2/1 19:36
 * @Created by 99126
 */
@TableName(value = "person")
@Data
public class Person {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "name")
    private String name;

    @TableField(value = "address")
    private String address;

    @TableField(value = "age")
    private Integer age;

    @TableField(value = "create_date")
    private Date createDate;

    /**
     * 这个列具有唯一索引, 作用如下:
     * - id_card=1的数据已经存在, 测试在一个事务方法中先删除id_card=1的数据然后再插入id_card=1的数据, 确认是否可以插入成功.
     */
    @TableField(value = "id_card")
    private String idCard;

}
